
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="js/ol.css">
    <script src="lib/jquery/jquery-3.3.1.min.js"></script>
    <script src="js/ol-debug.js"></script>

</head>

</head>
<body>
<div id="map"></div>
    <script type="text/javascript">
            var map = new ol.Map({
                target: 'map',
                layers: [
                    new ol.layer.Tile({
                        source: new ol.source.TileArcGISRest({
                            url: 'http://localhost:6080/arcgis/rest/services/test/cadcustom/MapServer'
                        })
                    })
                ],
                view: new ol.View({
                    center: [509018, 299803],
                    zoom: 14,
                    projection: 'EPSG:3857'
                })
            });


        map.on('click', function(evt) {
            var coor=evt.coordinate;
            alert(coor);
        });
    </script>
</body>
</html>